Skip to content

Conversation

@npslaney
Copy link
Contributor

Add schemas and contracts for mcp API

npslaney and others added 3 commits January 23, 2026 13:26
Add separate mcpContract namespace for MCP tools:
- customers: list, get, create, update, delete
- products: list, get, create, update, delete
- orders: list, get (read-only)
- checkouts: list, get (read-only)

Export mcpContract from index.ts alongside SDK contract.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Organize imports alphabetically
- Use Number.isNaN instead of global isNaN
- Format multi-line exports

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@npslaney
Copy link
Contributor Author

@codex review please

@chatgpt-codex-connector
Copy link

To use Codex here, create a Codex account and connect to github.

@npslaney
Copy link
Contributor Author

@codex please review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2aededc029

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

npslaney and others added 2 commits January 26, 2026 15:30
- Use OrderStatusSchema instead of z.string() for status field
- Use CurrencySchema instead of z.string() for currency field
- Export OrderStatusSchema and OrderStatus type for consumers

This ensures the contract validates against known enum values rather than
accepting arbitrary strings, preventing silent acceptance of invalid values.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@npslaney
Copy link
Contributor Author

@codex check again please

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: da5159882d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

…erval

- Rename RecurringIntervalWithNeverSchema → RecurringIntervalInputSchema
- Export RecurringIntervalInputSchema and RecurringIntervalInput type
- Document that server normalizes "NEVER" to null when storing/returning

Input accepts "NEVER" for one-time products, output uses null.
Server-side normalization ensures contract consistency.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@npslaney
Copy link
Contributor Author

@codex one more check please

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Nice work!

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

npslaney and others added 6 commits January 26, 2026 16:40
Add pagination-based list endpoint for checkouts with optional status filter.
This merges the MCP checkouts.list functionality into the unified checkout contract.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Add get, create, update, delete endpoints to products contract.
Keep existing list endpoint unchanged (no pagination).

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Add customer contract with CRUD operations (list, get, create, update, delete).
Uses singular naming convention.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Add order contract with list and get operations.
Uses singular naming convention.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Remove the separate mcp/ directory and mcpContract export.
All contracts are now in the unified contract object.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Add sdkContract and mcpContract exports that contain only the methods
each router implements. This allows proper TypeScript validation while
keeping the unified contract for type sharing.

- sdkContract: checkout.get/create/confirm/etc, onboarding.*, products.list
- mcpContract: customer.*, order.*, checkout.list/get (summary), products.*
- Add CheckoutListItemSchema and CheckoutDetailSchema for MCP endpoints
- These are simpler than the full CheckoutSchema used by SDK

Co-Authored-By: Claude Opus 4.5 <[email protected]>
id: z.string(),
name: z.string().optional(),
email: z.string().email().optional(),
userMetadata: z.record(z.string(), z.string()).optional(),
Copy link
Contributor

@amackillop amackillop Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have metadata defined on many schemas but in many different ways. I think we should have a single Metadata schema that gets re-used. Can be a future ticket as it is probably an existing problem

npslaney and others added 2 commits January 27, 2026 11:34
- Replace inline CheckoutCustomerSchema with CustomerSchema.nullable()
- Remove unnecessary OrderDetailSchema alias

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@npslaney npslaney merged commit e904a70 into main Jan 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants